-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BasisUniversal: Use RGTC compression when available #90170
BasisUniversal: Use RGTC compression when available #90170
Conversation
3915916
to
5f125f3
Compare
5f125f3
to
01406ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected. The normal map texture (displayed on the right) seems more yellow but I don't know how close this is to ground truth, as we currently lack a way to have Lossless-compressed textures be imported as RG8 (Normal Map import option isn't available).
The final result (albedo with normal map) looks very close either way.
Testing project:
APKs for quick testing on Android:
Desktop
Before | After (this PR) |
---|---|
Mobile
Tested on Samsung Galaxy Z Fold4 (Adreno 730).
Before | After (this PR) |
---|---|
} else { | ||
// No supported VRAM compression formats, decompress. | ||
basisu_format = basist::transcoder_texture_format::cTFRGBA32; | ||
image_format = Image::FORMAT_RGBA8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't Image::FORMAT_RG8
or Image::FORMAT_LA8
be used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BasisU doesn't allow directly decompressing textures to R8/RG8, so they have to be converted after decompression. This increases the loading time slightly, though I think the tradeoff is worth it since less VRAM is wasted.
} else { | ||
// No supported VRAM compression formats, decompress. | ||
basisu_format = basist::transcoder_texture_format::cTFRGBA32; | ||
image_format = Image::FORMAT_RGBA8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't Image::FORMAT_R8
be used here?
01406ff
to
838a67e
Compare
838a67e
to
337d80d
Compare
Thanks! |
Depends on #89426
Changes BasisUniversal's destination format for normal maps from
(DXT5/ETC2)_RA-As-RG
toRGTC_RG
/ETC2_RG11
, which results in a slight quality gain.Also adds support for encoding R-channel only images and decoding them as
RGTC_R
/ETC2_R11
.This needs testing on mobile devices, but I suspect the difference in quality will be most significant there.
MRP:
basisurgtctest.zip